package com.woniuxy01;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Random;

/**
@author 作者
@create 2025-07-28 10:43
*/public class Test03 {
    public static void main(String[] args) {
//        String source="ab-cd-ef-g";
//        String target="-";
//        System.out.println(source.replace("-","*"));
//        System.out.println(source.replaceAll("-","*"));

//        String source="ab.cd.ef.g";
//        String target="-";
//        System.out.println(source.replace(".","*"));
//        System.out.println(source.replaceAll(".","*"));
//        System.out.println(source.replaceAll("\\.","*"));


//        System.out.println("aaa\\taaa");
//        System.out.println("aaa\\naaa");
//        System.out.println("aaa\"aaa");


        //字符串包含若干单词使用-作为分割符号，讲字符串拆除单词
//        String strs="tom-jack-kite";
//        String[] words = strs.split("-");
//        String strs="tom.jack.kite";
//        String[] words = strs.split("\\.");
//        System.out.println(Arrays.toString(words));

        //所有的数字替换成*
        String str="abc123de456fgh789123ijkl";
        System.out.println(str.replaceAll("\\d", "*"));
        System.out.println(str.replaceAll("\\d+", "*"));

    }
    
}
